//    Copyright (C) Kherty.  All rights reserved.
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.Contracts;
using System.Reflection;
using OpenLS.Core.Notification;

namespace OpenLS.Spreadsheet.UI
{
    class FilterValue : ViewModelBase
    {
        private readonly FilterColumnViewModel _owner;

        
        internal FilterValue(string value, FilterColumnViewModel owner)
        {
            Contract.Requires(owner != null);
            this._value = value;
            _owner = owner;
        }

        private readonly string _value;
        public string Value
        {
            get { return _value; }
        }

        private bool _isSelected = true;

        public bool IsSelected
        {
            get { return _isSelected; }
            set
            {
                _isSelected = value;
                _owner.Apply(this);
                notifyPropertyChanged("IsSelected");
            }
        }

        private IEnumerable<FilterValue> _children;
        public  IEnumerable<FilterValue> Children
        {
            get { return _children; }
        }
	
    }
}
